//
//  DXWChannelGroupItem.m
//  pandaTV
//
//  Created by 淡馨慰 on 16/11/4.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "DXWChannelGroupItem.h"
#import "DXWChannelItem.h"
#import <MJExtension/MJExtension.h>

CGFloat const itemH = 40;

@interface DXWChannelGroupItem ()



@end

@implementation DXWChannelGroupItem

+ (NSDictionary *)objectClassInArray {
    
    return @{
             @"data" : @"DXWChannelItem"
             };
}
- (NSMutableArray *)data
{
    if (_data == nil) {
        _data = [NSMutableArray array];
    }
    return _data;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

//- (void)setData:(NSMutableArray *)data
//{
//    NSMutableArray *datas = [NSMutableArray array];
//    for (NSDictionary *dict in data) {
//        DXWChannelItem *tagGroup = [DXWChannelItem channelWithDict:dict];
//        [datas addObject:tagGroup];
//    }
//    _data = datas;
//}


- (CGFloat)cellH
{
    CGFloat originY = 27;
    CGFloat margin = 10;
    
    NSInteger cols = 3;
    NSInteger rows = (self.data.count - 1) / cols + 1;
    return rows * (itemH + margin) + originY;
}

@end
